<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script src="js/informationPage.js"></script>

<script type="text/javascript">
	$(function(){
		$("#foodcheckAll").click(function(){
			$(".foodcheck").prop('checked', $(this).is(":checked"));
		});
		
	});


</script>

<script>	
$( "#divAdminFoodDialogFile" ).dialog({
    autoOpen: false,
    height: 330,
    width: 450,
    modal: true,
    buttons: {
      "닫기": function() {
        $( this ).dialog( "close" );
      }
    },
    close: function() {
  
    }
  });
</script>

<!-- 
    모든 음식 정보 페이지
 -->
    <div id="adminMode" class="foodSearch">
		<div id="foodSearchbar">
			<h3>전체 음식 관리</h3>
			<form name="foodAllSearch">
				<table style="border: 1px solid gray; width:800px; height:60px;">
					<tr>
						<td style="vertical-align: middle;">
							음식명 : 
				            <input type="text" name="foodSearch" size="50"/>
				            <input type="submit" value="검색"/>
				       </td>
	            	</tr>
	            </table>
	        </form>
        </div>
        
        <div style="padding: 15px 0px"></div>
        <div id="divAdminFoodDialogFile" title="음식 사진 파일 업로드">
			<iframe id="foodFrame" src="" width="400" height="200" style="border:0;">
			</iframe>
			
		</div>
        
        <form id="adminfoodList" name="adminfoodList" method="post">
        <div id="foodAllList">
        	전체 음식 : 
        	<table style="border: 1px solid gray; width: 800px; text-align: center;">
				<tr style="background: skyblue; height: 30px;" >
					<td style="width: 10px"><input type="checkbox" id="foodcheckAll"></td>
					<td style="width: 50px;">No.</td>
					<td style="width: 250px;">음식명</td>
					<td style="width: 70px;">섭취목적</td>
					<td style="width: 70px;">음식종류</td>
					<td style="width: 70px;">음식분류</td>
					<td style="width: 70px;">삭제여부</td>
					<td style="width: 140px;">수정일</td>
					<td style="width: 70px;"></td>
            	</tr>
            	<c:forEach var="food" items="${food }">
            	<tr style="height: 30px;">
            		<td><input id="foodcheck" type="checkbox" name="foodcheck" class="foodcheck" value="${food.foodNo }"></td>
            		<td>${food.foodNo }</td>
					<td>${food.foodName }</td>
					<td>${food.foodIngestPurpose }</td>
					<td>${food.foodClass }</td>
					<td>${food.foodClassfication }</td>
					<td>${food.foodRemoveYn }</td>
					<td>
						<fmt:formatDate value="${food.updateDate }" type="date" dateStyle="long"/>
					</td>
					<td>		
						<a href="javascript:adminFoodPreModify(${food.foodNo });"><input type="button" value="수정하기"></a>
					</td>
            	</tr>
            	</c:forEach>
            	<tr>
					<td><input type="checkbox" class="foodcheck"></td>
					<td colspan="8" align="left">
						선택음식을 
						<input type="button" value="삭제하기" onclick="javascript:adminFoodRemove();">
						<input type="button" value="삭제취소" onclick="jacascript:adminFoodRemoveCancel();">
						<input type="button" value="사진추가" onclick="jacascript:adminFoodPicture();">
					</td>
            	</tr>
	        </table>
	        <div id="pageing" style="margin: 12px 0px 0px 314px;">	        
		       	${page }
	        </div>
        
        </div>
        </form>
        
</div>